{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 分析结果\n",
    "\n",
    "这是一个用于分析模型率定后测试结果的 Jupyter Notebook。读取各个exp下面的结果文件看看。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Please Check your directory:\n",
      "ROOT_DIR of the repo:  d:\\code\\hydro-model-xaj\n",
      "DATASET_DIR of the repo:  d:\\data\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "import sys\n",
    "from pathlib import Path\n",
    "\n",
    "sys.path.append(os.path.dirname(Path(os.path.abspath('')).parent))\n",
    "import definitions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "metric_mean_file = Path(os.path.join(\"D:/研究生/毕业论文/new毕业论文/预答辩/碧流河水库/模型运行/basins_test_metrics_mean_all_cases.csv\"))\n",
    "metric_median_file = Path(os.path.join(\"D:/研究生/毕业论文/new毕业论文/预答辩/碧流河水库/模型运行/basins_test_metrics_median_all_cases.csv\"))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "metric_mean = pd.read_csv(metric_mean_file, index_col=0)\n",
    "metric_median = pd.read_csv(metric_median_file, index_col=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Bias</th>\n",
       "      <th>RMSE</th>\n",
       "      <th>ubRMSE</th>\n",
       "      <th>Corr</th>\n",
       "      <th>R2</th>\n",
       "      <th>NSE</th>\n",
       "      <th>KGE</th>\n",
       "      <th>FHV</th>\n",
       "      <th>FLV</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>HFsources</th>\n",
       "      <td>-10.431724</td>\n",
       "      <td>84.941974</td>\n",
       "      <td>84.29898</td>\n",
       "      <td>0.625164</td>\n",
       "      <td>0.380791</td>\n",
       "      <td>0.380791</td>\n",
       "      <td>0.308037</td>\n",
       "      <td>-30.076788</td>\n",
       "      <td>-100.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                Bias       RMSE    ubRMSE      Corr        R2       NSE  \\\n",
       "HFsources -10.431724  84.941974  84.29898  0.625164  0.380791  0.380791   \n",
       "\n",
       "                KGE        FHV    FLV  \n",
       "HFsources  0.308037 -30.076788 -100.0  "
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "metric_mean"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Bias</th>\n",
       "      <th>RMSE</th>\n",
       "      <th>ubRMSE</th>\n",
       "      <th>Corr</th>\n",
       "      <th>R2</th>\n",
       "      <th>NSE</th>\n",
       "      <th>KGE</th>\n",
       "      <th>FHV</th>\n",
       "      <th>FLV</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>HFsources</th>\n",
       "      <td>-10.431724</td>\n",
       "      <td>84.941974</td>\n",
       "      <td>84.29898</td>\n",
       "      <td>0.625164</td>\n",
       "      <td>0.380791</td>\n",
       "      <td>0.380791</td>\n",
       "      <td>0.308037</td>\n",
       "      <td>-30.076788</td>\n",
       "      <td>-100.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                Bias       RMSE    ubRMSE      Corr        R2       NSE  \\\n",
       "HFsources -10.431724  84.941974  84.29898  0.625164  0.380791  0.380791   \n",
       "\n",
       "                KGE        FHV    FLV  \n",
       "HFsources  0.308037 -30.076788 -100.0  "
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "metric_median"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.9.7 ('xaj')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.12"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "5ff2b0240d3185dc85fb5f0a6365eefe977ea7c2afca8c64838dc9fcf4f02a96"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
